package jn.chen.utils.interfaceController.util;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @className: GlobalExceptionHandler
 * @author: chenLin
 * @version: 1.0.0
 * @description:
 * @date: 24/1/15 015 14:52
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(RuntimeException.class)
    public R error(RuntimeException e) {
        e.printStackTrace();
        return R.error(e.getMessage());
    }
}
